# !/usr/bin python3
# encoding: utf-8 -*-
# @file     : login_actions.py
# @author   : 沙陌 Matongxue_2
# @Time     : 2023/9/5 20:54
# @Copyright: 北京码同学
from pages.buyer.home_page import HomePage
from pages.buyer.login_page import LoginPage


class BuyerLoginActions:

    def buyer_login(self,username,password,valicode='1512'):
        # HomePage().click_login_link()
        # login_page = LoginPage()
        # login_page.click_user_login()
        # login_page.send_keys_username(username)
        # login_page.send_keys_password(password)
        # login_page.send_keys_valicode(valicode)
        # login_page.click_login_btn()
        # 可选参数必须在必需参数的前面

        # 链式调用
        HomePage().click_login_link()\
            .click_user_login()\
            .send_keys_username(username)\
            .send_keys_password(password)\
            .send_keys_valicode(valicode)\
            .click_login_btn()